﻿using CubeCube.Utils;

namespace CubeCube.Tile.Rule
{
    //普通规则
    public class TileRule
    {
        public TileRuleCondition condition;

        public TileRule()
        {
        }

        public TileRule(TileRuleCondition condition)
        {
            this.condition = condition;
        }

        public bool CheckConditions(TileManager tileManager, Tile tile, IndexPosition worldPos)
        {
            if (condition != null)
                return condition.Validate(tileManager, tile, worldPos);

            return true;
        }

        public virtual void Execute(TileManager tileManager, Tile tile, IndexPosition worldPos)
        {

        }

        //TODO: 序列化
    }
}
